package cn.tedu.boot52.mapper;

import cn.tedu.boot52.entity.Emp;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface EmpMapper {
    @Insert("insert into newemp values (null,#{name},#{job},#{sal})")
    void insert(Emp emp);

    @Delete("delete from newemp where id=#{id}")
    void delete(int id);

    @Update("update newemp set name=#{name},job=#{job},sal=#{sal} where id=#{id}")
    void update(Emp emp);

    @Select("select * from newemp")
    List<Emp> select();

    @Select("select * from newemp where id=#{id}")
    Emp selectById(int id);

}
